﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VIPExchangePartLookUpList.aspx.cs" Inherits="IHISCETeim.Web.AgentSys.VipMgr.VIPExchangePartLookUpList" %>

<form id="pagerForm" method="post" action="VipMgr/VIPExchangePartLookUpList.aspx">
<input type="hidden" name="ItemCode" value="<%=ItemCode %>" />
<input type="hidden" name="orderField" value="<%=orderField %>" />
<input type="hidden" name="orderDirection" value="<%=orderDirection %>" />
<input type="hidden" name="pageNum" value="1" />
<input type="hidden" name="numPerPage" value="20" />
</form>
<form id="form1" runat="server" method="post" action="VipMgr/VIPExchangePartLookUpList.aspx" onsubmit="return dialogSearch(this);">
<div class="pageHeader">
    <div class="searchBar">
        <table class="searchContent">
            <tr>
                <td>                   
                    物料号/名称： <input name="ItemCode" type="text" value="<%=ItemCode %>"  />
                </td>
                <td>
                     <div class="subBar">
                        <ul>
                            <li>
                                <div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div>
                            </li>
                        </ul>
                    </div>
                </td>               
            </tr>
        </table>
    </div>
</div>
<div class="pageContent ">
    <asp:repeater id="rpMenu" runat="server">
        <HeaderTemplate>
        <table class="list" width="100%" layouth="60" targetType="dialog">
        <thead>
            <tr  >        
                <th width="100" <%=GetDataListOrder("ItemCode") %>>物料号</th>
                <th width="200" <%=GetDataListOrder("ItemName") %>>名称</th>     
                 <th width="100">单价</th>            
                <th width="120">本次兑换数量</th> 
                <th width="70">添加</th>             
            </tr>
        </thead> 
        <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr id="VIPExchangePartLookUpList<%# Eval("ItemCode") %>" >
                <td><%# Eval("ItemCode")%></td>
				<td><%# Eval("ItemName")%></td>
                <td><input type="text" name="Price" value="<%# GetPrice(Eval("GuidePrice"),Eval("ItemCode")) %>" /></td>
                <td><input type="text" name="Quantity" value="1" /></td>			
			    <td>
					<a class="btnSelect" title="新增" href="javascript:onVIPExchangePartItemSelect('#VIPExchangePartLookUpList<%# Eval("ItemCode") %>','<%# Eval("ItemCode") %>', '<%# Eval("ItemName")%>')" title="">选择</a>
				 </td>
			</tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody>
         </table>
        </FooterTemplate>
    </asp:repeater>
    <script type="text/javascript">

        function onVIPExchangePartItemSelect($qItem, itemcode, itemname) {
            var $tr = $($qItem);
            var $Price = $tr.find(":text[name='Price']").val();
            var $Quantity = $tr.find(":text[name='Quantity']").val();
            if (parseFloat($Quantity) <= 0) {
                alert("数量不能为0,请重新输入");
                return;
            }
            //alert(itemcode)
            onExchangePartItemSelectClick({ ItemCode: itemcode, ItemName: itemname, Price: $Price, Quantity: $Quantity });
            //$.pdialog.closeCurrent();
        }



    </script>
     <div class="panelBar">
        <div class="pages">
            <span>显示</span>
            <select class="combox" name="numPerPage" onchange="dialogPageBreak({numPerPage:this.value})">
               <%=SetnumPerPage() %>
            </select>
            <span>条，共<%=TotalCount%>条</span>
        </div>
        <div class="pagination" targettype="dialog" totalcount="<%=TotalCount%>" numperpage="<%=numPerPage %>"
            pagenumshown="10" currentpage="<%=pageNum %>">
        </div>
    </div>
</div>
</form>